<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <script type="text/javascript" src="__ITEM__/__UI__/jquery.js"></script>
 <script type="text/javascript" src="__ITEM__/__JS__/jquery.cookie.js"></script>
 <script language="javascript">
  var isskin = window.parent.isskin?window.parent.isskin:'winner-aliyun';
  document.write('<link id="easySty" rel="stylesheet" type="text/css" href="__ITEM__/__UI__/themes/'+isskin+'/easyui.css">');
  document.write('<link type="text/css" rel="stylesheet" href="__ITEM__/__ADMIN.CSS__/index.css">');
  document.write('<link id="adminSty" type="text/css" rel="stylesheet" href="__ITEM__/__ADMIN.CSS__/'+isskin+'/style.css">');
 </script>
 <link rel="stylesheet" type="text/css" href="__ITEM__/__UI__/themes/icon.css">
 <link rel="stylesheet" href="__ITEM__/__JS__/kindeditor/themes/default/default.css" />
 <link rel="stylesheet"  href="__ITEM__/__JS__/datepicker/skin/default/datepicker.css">  
 
 <!-- Easyui -->
 <script type="text/javascript" src="__ITEM__/__JS__/datepicker/WdatePicker.js"></script>
 <script charset="utf-8" src="__ITEM__/__JS__/kindeditor/kindeditor-min.js"></script>
 <script charset="utf-8" src="__ITEM__/__JS__/kindeditor/lang/zh_CN.js"></script>
 <link href="__ITEM__/__JS__/kindeditor/plugins/code/shCoreDefault.css" rel="Stylesheet" type="text/css" />
 <script src="__ITEM__/__JS__/kindeditor/plugins/code/shCore.js"></script>
 
 <script type="text/javascript" src="__ITEM__/__UI__/jquery.easyui.min.js"></script>
 <script type="text/javascript" src="__ITEM__/__UI__/locale/easyui-lang-zh_CN.js"></script> 
 <script type="text/javascript" src="__ITEM__/__UI__/plugins/jquery.kindeditor.js"></script>
 <script type="text/javascript" src="__ITEM__/__UI__/plugins/jquery.datepicker.js"></script>
 
 <script type="text/javascript" src="__ITEM__/__JS__/objFunc.js"></script> 
 <script type="text/javascript" src="__ITEM__/__JS__/objClass.js"></script>
 <script type="text/javascript" src="__ITEM__/__JS__/acrossClass.js"></script> 
 <script charset="utf-8" src="__ITEM__/__JS__/kindeditor/plugins/image/image.js"></script>
<script language="javascript">
   SyntaxHighlighter.all();
</script>
<script language="javascript">
$(function(){
	$("#setStatus{$uniqid}").linkbutton({
		iconCls:'icon-edit'
	});
	
	$("#setUser{$uniqid}").linkbutton({
		iconCls:'icon-edit'
	});
	
	$("#upFile{$uniqid}").linkbutton({
		iconCls:'icon-import'
	});
	
	$("#re{$uniqid}").linkbutton({
		iconCls:'icon-reset'
	});
	
	$("#reply{$uniqid}").kindeditor({
		uploadJson:'__APP__/Public/Upload/save/act/ReportReply'
	});
	
	$("#status{$uniqid}").combobox({
		url:'__ITEM__/__RUNTIME__/Data/Json/Linkage/wentizhuangtai_notit_data.json',
		editable:false,
		method:'get',
		required:false,
		valueField:'id',
		textField:'text'
	});
	
	var act = 1;
	$("#user_id{$uniqid}").combotree({
		required:true,
		url:'__ITEM__/__RUNTIME__/Data/Json/User_tree_data.json',
		editable:true,
		method:'get',
		required:false,
		valueField:'id',
		textField:'text',
		keyHandler: {
			query : function(q) {
				queryComboTree(q, "user_id{$uniqid}", 0);
			}
		},
		onBeforeSelect:function(node){
			if(isset(node.children)){
				$("#user_id{$uniqid}").tree("unselect");
			}
		}
	});
});

function onCloseReport(idd){
	cancel['ReportDetail'].dialog('close');
	cancel['ReportDetail'].dialog('destroy');
	cancel['ReportDetail'] = null;
}


function onReplyReport(idd){
	var k = $("#reply{$uniqid}").kindeditor('editor');
	isempty = k.isEmpty();
	window.parent.addSonReport(idd,isempty);
}

function toDel(id){
	window.parent.delSonReport(id);
}

function onUploadReport(idd){
	window.parent.addSonUpload(idd);
}

function onDelUpload(id,uid,path){
	window.parent.delSonUpload(id,uid,path);
}

function toRe(id){
	var k = $("#reply{$uniqid}").kindeditor('editor');
	k.html("@"+id+"：");
	$("#replyBox").parent().scrollTop(99999);
}

function toReTop(){
	$("#replyBox").parent().scrollTop(99999);
}

function onSetUser(idd,id){
	var uid = $("#user_id"+idd).combobox('getValue');
	var olduser = $("#olduser"+idd).val();
	window.parent.setSonUser(uid,olduser,id);
}

function setStatus(idd,id){
	var status = $("#status"+idd).combobox('getValue');
	var oldstatus = $("#oldstatus"+idd).val();
	window.parent.setSonStatus(status,oldstatus,id);
}

$(function(){
	$.ajaxSetup({  
		async : false  
	});
	
	var browser_cache = Boolean(Number('{$TC.config.BROWSER_CACHE}'));
	jQuery.ajaxSetup ({cache:browser_cache});
	var isskin = $.cookie('easyui');
	//alert(isskin);
	if(isskin){
		$("#adminSty").attr("href","__ITEM__/__ADMIN.CSS__/"+isskin+"/style.css");
		$("#easySty").attr("href","__ITEM__/__UI__/themes/"+isskin+"/easyui.css");
	}
	$.ajaxSetup({  
		async : true  
	});
});

function onDown(id){
	window.location = "__URL__/down/id/"+id;
}
</script>
<div id="replyBox" class="con-tb"> 
<table class="infobox linebox" width="100%" border="0" cellspacing="0" cellpadding="0" style="font-size:13px;">
  <tr>
    <td width="11%" class="rebg"><label for="bugno">问题编号</label></td>
    <td width="22%">{$info.bugno}&nbsp;<if condition="$uid!=$info['crearor']">[<a class="up-font" href="javascript:void(0);" onClick="toReTop()">反馈</a>]</if></td>
    <td width="11%" class="rebg"><label for="creator">创建人</label></td>
    <td width="23%">{$info.createname}</td>
    <td width="11%" class="rebg"><label for="addtime">创建时间</label></td>
    <td width="22%">{$info.addtime}</td>
    </tr>
  <tr>
    <td class="rebg"><label for="level">严重性</label></td>
    <td>{$info.level}</td>
    <td class="rebg"><label for="pid">所属项目</label></td>
    <td>{$info.proname}</td>
    <td class="rebg"><label for="addtime">修改时间</label></td>
    <td>{$info.uptime}</td>
    </tr>
  <tr>
    <td width="11%" class="rebg"><label for="type">出现位置</label></td>
    <td width="22%">{$info.type}</td>
    <td width="11%" class="rebg"><label for="hertz">频率</label></td>
    <td>{$info.hertz}</td>
    <td class="rebg"><label for="priority">优先级</label></td>
    <td>{$info.priority}</td>
    </tr>
  <tr>
    <td class="rebg"><label for="title">摘要</label></td>
    <td colspan="3">{$info.title}</td>
    <td class="rebg"><label for="oldstatus">当前状态</label></td>
    <td>{$info.statusname}</td>
    </tr>
  <tr>
    <td height="29" class="rebg"><label for="user_id">指派给</label></td>
    <td><?php echo $info['username']?$info['username']:'无' ?></td>
    <td class="rebg3"><if condition="$isadmin==1 || $uid==$info['user_id'] || $uid==$info['creator']"><label for="user_id">重新指派</label></if></td>
    <td><if condition="$isadmin==1 || $uid==$info['user_id'] || $uid==$info['creator']"><input name="user_id" id="user_id{$uniqid}" class="relo" size="18" /><input name="olduser" id="olduser{$uniqid}" type="hidden" value="{$info.user_id}" />&nbsp;<a href="javascript:void(0);" onClick="javascript:onSetUser('{$uniqid}','{$id}')" id="setUser{$uniqid}">更改</a></if></td>
    <td class="rebg3"><if condition="$isadmin==1 || $uid==$info['user_id'] || $uid==$info['creator']"><label for="status">更改状态</label></if></td>
    <td><if condition="$isadmin==1 || $uid==$info['user_id'] || $uid==$info['creator']"><input name="status" id="status{$uniqid}" class="relo" size="15" /><input name="oldstatus" id="oldstatus{$uniqid}" type="hidden" value="{$info.status}" />&nbsp;<a href="javascript:void(0);" onClick="javascript:setStatus('{$uniqid}','{$id}')" id="setStatus{$uniqid}">更改</a></if></td>
    </tr>
   
   <tr>
    <td class="rebg"><label for="notes">详细现象</label></td>
    <td colspan="5"  >{$info.baseinfo.notes}</td>
    </tr>
   <tr>
    <td class="rebg"><label for="comment">备注</label></td>
    <td colspan="5"  >{$info.baseinfo.comment}</td>
    </tr>
  <if condition="$isadmin==1 || $uid==$info['user_id'] || $uid==$info['creator']">
  <tr>
    <td height="29" class="rebg3"><label for="files">选择文件</label></td>
    <td colspan="5">
    <form method="post" enctype="multipart/form-data" id="uploadFormReport{$uniqid}" style="margin-bottom:0px;">
    <input name="path" type="file" />&nbsp;<a href="javascript:void(0);" onClick="javascript:onUploadReport('{$uniqid}')" id="upFile{$uniqid}">上传</a>&nbsp;<span class="up-font-over">(文件类型：<?php echo C('UPLOAD_TYPE'); ?>)</span>
    </form>
    </td>
  </tr>
  </if>
  <if condition="$info['files']"> 
  <tr>
    <td class="rebg"><label for="files">附件</label></td>
    <td colspan="5" style="padding:5px;">
    <?php
     foreach($info['files'] as $k=>$s){
      if($k%2!=0){
       $even = 'rebg6';
      }else{
       $even = 'rebg2';
      }
    ?>
      <div class="{$even}" style="line-height:26px; padding-left:5px;"><a  href="javascript:onDown({$s.id});"><img src="__ITEM__/__ADMIN.IMG__/files.png" />{$s['path']}</a>&nbsp;
      <if condition="$isadmin==1 || $uid==$s['user_id']">
      [<a class="up-font" href="javascript:void(0);" onClick="javascript:onDelUpload('{$s.id}','{$s.user_id}','{$s.path}')">删除</a>]
      </if>
      </div>
    <?php
     }
    ?>
    </td>
    </tr>
  </if>
  <tr >
    <td colspan="6" style="padding:5px;">
     <if condition="$info['reply']">
     <div style="">
         <div class="detail-tit">反馈</div> 
         <div>
         <table class="infobox table-border" width="100%" border="0" cellspacing="0" cellpadding="0">
           <?php
            foreach($info['reply'] as $k=>$s){
             if($k%2==0){
                $cls = 'class="rebg5"';
             }else{
                $cls = '';
             }
           ?>
            <tr>
                <td height="46" {$cls}>
                 <div class="tpt"><span class="rpl">{$s.username} 于	 {$s.replytime} 发表的反馈</span><span class="rpr"><if condition="$uid!=$s['user_id']">[<a href="javascript:void(0);" onClick="toRe('{$s.username}')">回复</a>]</if>&nbsp;&nbsp;<if condition="$uid==$s['user_id'] || $isadmin==1"><!--<a href="javascript:onEdit('{$t.id}');">[编辑]</a>&nbsp;&nbsp;--><a href="javascript:void(0);" onClick="toDel({$s.id})">[刪除]</a></if></span></div>
                 <div class="tpc">{$s.description}</div>
                </td>
           </tr>
          <?php
           }
          ?> 
          </table>
          <div class="pages">{$showpage}</div>
       </div>
     </div>
	 <else />
      <div style="">
         <div class="detail-tit">暂无反馈</div> 
      </div>
     </if>
    </td>
    </tr> 
  <tr >
    <td class="rebg"></td>
    <td colspan="5" style="padding:10px" valign="middle">
    <form method="post" id="replyFormReport{$uniqid}" style="margin-bottom:0px;">
    <textarea name="description" id="reply{$uniqid}"  rows="18" style="width:99.8%; height:160px"></textarea>
    <a style="margin-top:3px;" href="javascript:void(0);" onClick="javascript:onReplyReport('{$uniqid}')" id="re{$uniqid}">发表反馈</a> <input id="ids{$uniqid}" type="hidden" value="{$id}" />
    </form>
    </td>
    </tr> 
  <!--
  <tr>
    <td height="38" colspan="4" align="center"><a href="#" onclick="javascript:onMailReport('{$uniqid}')" id="ma{$uniqid}">邮件提醒</a> &nbsp; <a href="#" onclick="javascript:onCloseReport('{$uniqid}')" id="co{$uniqid}">关闭</a></td>
    </tr>
   -->
 </table>
</div>
<div id="addOpts"></div>
</body>
</html>